package com.coolwen.spring.ioc_xml.controller;/**
 * Created by CoolWen on 2017/8/21.
 */


import com.coolwen.spring.ioc_xml.model.User;
import com.coolwen.spring.ioc_xml.service.UserService;

import java.util.List;

/**
 * @author CoolWen
 * @version 2017-08-21 16:34
 */
public class UserController {
    private User user;
    private UserService userService;
    private int id;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void add() {
        userService.add(user);
    }


    public void delete() {
        userService.delete(id);
    }

    public void load() {
        userService.load(id);
    }
}
